import request from "@/utils/request";

export function cartQuantityService(businessId,userId){
    return request.get('/cart/list?businessId='+businessId+'&userId='+userId)
}

export function cartSaveService(cartData){
    return request.post('/cart/save',cartData)
}

export function cartUpdateService(cartData){
    return request.put('/cart/update',cartData)
}

export function cartRemoveService(businessId,foodId,userId){
    if(foodId===0){
        return request.post('/cart/remove?businessId='+businessId+'&userId='+userId)
    }else {
        return request.post('/cart/remove?businessId='+businessId+'&userId='+userId+'&foodId='+foodId)
    }

}